<extend name="Public:admin"/>
<block name="extra-js">
<script src="__JS__/common/setCover.js"></script>
<script src="__JS__/common/postEdit.js"></script>
<script type="text/javascript">
$(function(){
	$(".editbtn").bind("click",function(){
		var $key = $(this).attr("data");
		$.ajax({
			url:"__URL__/edit",
			data: { key: $key },
			type:"post",
			dataType:"text",
			success: function(data){
				$data = $.parseJSON(data);
				$("#edit_res_name").val($data["res_name"]);
				$("#edit_res_introduction").val($data["res_introduction"]);
				$("#edit_res_time").val($data["res_time"]);
				$("#edit_res_tel").val($data["res_tel"]);
				$("#edit_res_location").val($data["res_location"]);
				$("#edit_res_feature").val($data["res_feature"]);
				$("#edit_res_notice").val($data["res_notice"]);
				$("#res_edit_form").attr("action","__URL__/update?place="+$key);
				$("#resEditModal").modal("show");
			}
		});
	});
});
</script>
</block>
<block name="main-content">
		<div class="row">
		<!-- start 餐饮信息 -->
		        <h1>餐饮信息</h1>
		        <form class="form-horizontal" role="form" method="post" id="res_form">
		        	<volist name="res_arr" id="vo">
						<h2>{$vo.res_name}</h2>
						<div class="btn-group" role="group">
							<a href="javascript:void(0)" class="btn btn-default editbtn" data="{$key}">编辑</a>&nbsp;
							<a href="__URL__/delete?place={$place}&key={$key}" class="btn btn-default">删除</a>
						</div><br><br>
						<div class="panel panel-default">
						  <div class="panel-heading">
						    <h3 class="panel-title">餐厅名字</h3>
						  </div>
						  <div class="panel-body">
						    {$vo.res_name}
						  </div>
						</div>
						<div class="panel panel-default">
						  <div class="panel-heading">
						    <h3 class="panel-title">简介</h3>
						  </div>
						  <div class="panel-body">
						    {$vo.res_introduction}
						  </div>
						</div>
						<div class="panel panel-default">
						  <div class="panel-heading">
						    <h3 class="panel-title">营业时间</h3>
						  </div>
						  <div class="panel-body">
						    {$vo.res_time}
						  </div>
						</div>
						<div class="panel panel-default">
						  <div class="panel-heading">
						    <h3 class="panel-title">餐厅地址</h3>
						  </div>
						  <div class="panel-body">
						    {$vo.res_location}
						  </div>
						</div>
						<div class="panel panel-default">
						  <div class="panel-heading">
						    <h3 class="panel-title">预定电话</h3>
						  </div>
						  <div class="panel-body">
						    {$vo.res_tel}
						  </div>
						</div>
						<div class="panel panel-default">
						  <div class="panel-heading">
						    <h3 class="panel-title">餐厅特色</h3>
						  </div>
						  <div class="panel-body">
						    {$vo.res_feature}
						  </div>
						</div>
						<div class="panel panel-default">
						  <div class="panel-heading">
						    <h3 class="panel-title">注意事项</h3>
						  </div>
						  <div class="panel-body">
						    {$vo.res_notice}
						  </div>
						</div>
	
					</volist>
				</form>
		<!-- end 餐饮信息 -->
			<div class="row">
				<button class="btn btn-success" data-toggle="modal" data-target="#resModal" href="#">添加信息</button>
			</div>
			<!-- start modal -->
<include file="Public/resCreatemodal" />
<include file="Public/resEditmodal" />
			<!-- end modal -->
		</div>
</block>

